<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="common_css :: commonHeader('定时任务管理')"></head>
<body>
<!--搜索框-->
<form method="post" id="tabfrom">
    <div style="padding:2px" class="easyui-panel" title="数据查询">
        <table class="form-table">
            <td align="right" width="10%">任务模块：</td>
            <td align="left">
                <input id="selBeanName" style="width:150px" class="easyui-validatebox"/>
            </td>
            <td align="right" width="10%">任务状态：</td>
            <td align="left">
                <input style="width:150px" id="selStatus"
                       class="easyui-combobox" data-options="prompt:'==请选择==',panelHeight:'auto', valueField: 'label', textField: 'value',
            data: [{ label: '1',  value: '正常' },{ label: '2', value: '暂停'}]"/>
                <a class="easyui-linkbutton" iconCls='icon-search' onclick="doSearch();">查询</a>
            </td>
        </table>
    </div>
    <br>
</form>
<div id="toolbar">
    <shiro:hasPermission name="schedule:job:add">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add" onclick="addScheduleJob()">添加</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="schedule:job:edit">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-edit" onclick="editScheduleJob()">修改</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="schedule:job:del">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel" onclick="delScheduleJob()">删除</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="schedule:job:run">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-pencil-go"
           onclick="runScheduleJob()">立即执行</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="schedule:job:pause">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-paintcan-red"
           onclick="pauseScheduleJob(0)">暂停</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="schedule:job:resume">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-paintcan-red"
           onclick="pauseScheduleJob(1)">恢复</a>
    </shiro:hasPermission>
</div>

<div id="dg"></div>


<div id="dlg" class="easyui-dialog" style="width:650px;height:400px"
     closed="true" modal="true" maximizable="true" resizable="true">

    <form id="myform" method="post">
        <div style="padding:20px">
            <table cellpadding="2px" cellspacing="0" class="form-table">
                <input type="hidden" name="id" id="id"/>
                <tr>
                    <td>任务模块：</td>
                    <td><input name="beanName" id="beanName" class="easyui-validatebox" data-options="required:true"
                               missingMessage="请输入任务模块名称"/></td>
                    <td>任务方法：</td>
                    <td><input class="easyui-validatebox" name="methodName"
                               data-options="required:true"
                               missingMessage="请输入任务方法"/></td>
                </tr>
                <tr>
                    <td>任务参数：</td>
                    <td><input class="easyui-validatebox" name="params"/></td>
                    <td>cron表达式：</td>
                    <td><input class="easyui-validatebox" name="cronExpression"
                               data-options="required:true"
                               missingMessage="请输入cron表达式"/></td>
                </tr>
                <tr>
                    <td>任务状态：</td>
                    <td>
                        <input style="width:150px" name="status" id="status" editable="false"
                               class="easyui-combobox" data-options="prompt:'==请选择==',panelHeight:'auto'
                               , valueField: 'label', textField: 'value',data: [{ label: '1',  value: '正常' },{ label: '2', value: '暂停'}]"/>
                    </td>
                </tr>
                <tr>
                    <td>任务描述：</td>
                    <td colspan="3">
                        <input class="easyui-textbox" name="remark"
                               data-options="multiline:true" style="height:80px;width:350px"/>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</div>

<div th:include="common_js :: commJS"></div>
<script type="text/javascript"
        th:src="@{/js/schedule/job.js}"></script>
</body>
</html>